<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title>已申报药品企业</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
<div class="box box-primary" id="more" style="width:70px;height:40px;background-color:#222c32;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#222c32;">
            <!-- <div class="box-header with-border">
                	更多操作
            </div> --><!-- /.box-header -->
            <div class="box-body home-message" id="moreOp">
            </div>
        </div>
    <section class="content-header">
        <h1>已申报药品企业</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">招标采购管理</a></li>
            <li class="active"><a href="#">已申报药品企业</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                        <label for="txtDrugName">企业编号：</label>
                        <input class="form-control" type="text" id="compCode" name="compCode" placeholder="企业编号" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">企业名称：</label>
                        <input class="form-control" type="text" id="compName" name="compName" placeholder="企业名称" />
                    </div>
                    <button type="button" onclick="gridSerch()" class="btn btn-success btn-sm">查询</button>
                </div>
            </div>
        </div>

        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>

        <div class=" box box-warning bottongroup">
            <a href="${ctx }/bidProject/toAuditCompprofileProjList.html?projId=${param.projId}" class="btn btn-default btn-sm">返回</a>
        </div>
    </section>
   
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script type="text/javascript">
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/bidProject/getDeclareDrugByCompDataList.html?projId=${projId}",
                mtype: "POST",
                postData: {"projId" : "${projId}"},
                datatype: "json",
                autowidth: true,
                //shrinkToFit:false,
                height: 270,
                colNames: ['projProddrugId','compId','企业编号', '企业名称','组织机构代码', '地区名称','企业注册类型名称','申报药品','操作'],
                colModel: [
					{ name: 'projProddrugId', hidden:true,width: 100, align: 'center' ,sortable: false},
					{ name: 'compId', hidden:true,width: 100, align: 'center' ,sortable: false},
                    { name: 'compCode', width: 160, align: 'center' ,sortable: false,
                    	formatter:function(cellvalue, options, row){ 
                    		return "<a href=\"javascript:$.HN.dialog.opendialog('"+cellvalue+"','企业详情','${ctx}/stdCompinfo/toStdCompinfoDetailJsp.html?compCodeDetail="+cellvalue+"','800px','400px',function operResult(val){return operResult;})\">"+cellvalue+"</a>"
                    				}},
                    { name: 'compName', width: 180, align: 'center' ,sortable: false},
                    { name: 'orgCode', width: 160, align: 'center' ,sortable: false},
                    { name: 'areaName', width: 160, align: 'center' ,sortable: false},
                    { name: 'compRegName', width: 170, align: 'center' ,sortable: false},
                    { name: 'prodCout', width: 170, align: 'center' ,sortable: false,formatter: function (val, opts, rowdata) {return "<a href=\"toCompDeclareDrugList.html?projId=${projId}&compId="+rowdata.compId+"\">"+val+"</a>";}},
                    { name: 'operate', width: 250,sortable: false, align:"center",
                    	formatter : function(val, opts, rowdata) {
                    		var str = "";
                    		str += "<a href='${ctx}/bidProject/toDrugCompprofileDetail.html?projId=${projId}&compId="+rowdata.compId+"&projProddrugId="+rowdata.projProddrugId+"'; style=\"display:block;height:24px;width:60px;margin:0 ;padding:0 ;float:left;line-height:24px\" >资质详情</a>";
                    		str+="<div id='"+rowdata.projId+"d' onmouseover=\"over('"+rowdata.projId+"','"+rowdata.projId+"','"+rowdata.name+"','"+rowdata.projProddrugId+"');\"  style='height:24px;width:50px;margin:0 ;padding:0 ;float:left;line-height:24px'><a>更多...</a></div>";
                    		return str;
                    	}	 }
                ],
                rowNum: 20,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "已申报药品企业列表",
                jsonReader: {
                    repeatitems: false  
                },
                loadComplete: function (data) { //完成服务器请求后，回调函数
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        //查询
        function gridSerch() {
        	var compCode = $("#compCode").val();
        	var compName = $("#compName").val();
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{"compCode":compCode,
    	        		"compName":compName}
    	    }).trigger("reloadGrid"); //重新载入  
    	}
      //鼠标移动事件
        function over(id,projId,compId,projProddrugId){//鼠标移入
    	  	 
        	$("#moreOp").children().remove();
        	var coord=$("#"+id+"d").offset();
        	$("#more").css("top",coord.top-1);
        	$("#more").css("left",coord.left-$("#more").width());
        	$("#more").show();  
        	$("#moreOp").append("<a id='"+id+"w'  href='${ctx}/bidProject/toDrugCompprofileAudit.html?projId=${projId}&compId="+compId+"&projProddrugId="+projProddrugId+"' style='color:#fff;float:left;display:block'>资质审核</a>");
        	$("#moreOp").append("<a id='"+id+"w'  href='${ctx}/bidProject/toDrugCompprofileDetailAudit.html?projId=${projId}&compId="+compId+"&projProddrugId="+projProddrugId+"' style='color:#fff;float:left;display:block'>澄清审核</a>");
        	
        	
        }
        //鼠标移出，隐藏
    	var flag = false;
	    var mouseX=0;
	    var mouseY=0;
        $(document).mousemove(function(e){
			  mouseX=e.pageX;
			  mouseY=e.pageY;
			  var coord=$("#more").offset();
	   		  if((mouseX<coord.left||mouseX>(coord.left+$("#more").width())||mouseY<coord.top||
	   				  mouseY>(coord.top+$("#more").height()))&&(mouseX<(coord.left+$("#more").width())||
	   						  mouseX>(coord.left+$("#more").width()+50)||mouseY<(coord.top+1)||mouseY>(coord.top+24+1))){
	   		  	  $("#more").hide();
	   		  } 
		});
        
        
       
      
        
        
    </script>
</body>
</html>